import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { RemoveTableService } from '../../public/serve/remove-table/remove-table.service';
import { HintsService } from '../../public/serve/hints/hints.service';
import {Service} from '../../server/server';
declare var $:any;
@Component({
  selector: 'app-internal-indexed-attr-time-delete',
  templateUrl: './internal-indexed-attr-time-delete.component.html'
})
export class InternalIndexedAttrTimeDeleteComponent implements OnInit {

  ids : any;
  deleteId : any;
  public internalDeleteThemeIdEmit: any;
  constructor(
      public server: Service,
    public removeTableService: RemoveTableService,
    private hintsService: HintsService
  ) { }

  ngOnInit() {
      this.internalDeleteThemeIdEmit = this.server.internalDeleteThemeIdEmit.subscribe((value: any) => {
          if (value) {
             this.deleteId = value;
          }
      });
  }

  ngOnDestroy() {
    this.internalDeleteThemeIdEmit ? this.internalDeleteThemeIdEmit.unsubscribe() : '';
  }

  //左侧内文的删除
  _deletePopover(){
    this.server.internalDeleteContentsEmit.emit(this.deleteId);
    this.server.internalindexeddeleteentEmit.emit(true);
    setTimeout(()=>{
      $(".ng-popver").hide();
    },200);
    this.hintsService.messages('删除成功！','0000');
  }

}
